import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizPlanIteration = (params) => {
  params.head.transCode = 'queryBizPlanIteration';
  return request({
    url: '/biz/plan/bizPlanIteration/queryBizPlanIteration',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizPlanIterationListPage = (params) => {
  params.head.transCode = 'queryBizPlanIterationListPage';
  return request({
    url: '/biz/plan/bizPlanIteration/queryBizPlanIterationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizPlanIteration = (params) => {
  params.head.transCode = 'saveBizPlanIteration';
  return request({
    url: '/biz/plan/bizPlanIteration/saveBizPlanIteration',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizPlanIterationList = (params) => {
  params.head.transCode = 'saveBizPlanIterationList';
  return request({
    url: '/biz/plan/bizPlanIteration/saveBizPlanIterationList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizPlanIteration = (params) => {
  params.head.transCode = 'saveOrUpdateBizPlanIteration';
  return request({
    url: '/biz/plan/bizPlanIteration/saveOrUpdateBizPlanIteration',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizPlanIterationList = (params) => {
  params.head.transCode = 'saveOrUpdateBizPlanIterationList';
  return request({
    url: '/biz/plan/bizPlanIteration/saveOrUpdateBizPlanIterationList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizPlanIteration = (params) => {
  params.head.transCode = 'updateBizPlanIteration';
  return request({
    url: '/biz/plan/bizPlanIteration/updateBizPlanIteration',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizPlanIteration = (params) => {
  params.head.transCode = 'deleteBizPlanIteration';
  return request({
    url: '/biz/plan/bizPlanIteration/deleteBizPlanIteration',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizPlanIterationList = (params) => {
  params.head.transCode = 'deleteBizPlanIterationList';
  return request({
    url: '/biz/plan/bizPlanIteration/deleteBizPlanIterationList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizPlanIterationExcel = (params) => {
  downloadExcel({
    url: '/biz/plan/bizPlanIteration/excelDownload/exportBizPlanIterationExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
